package data.set.implementation;

import java.util.Iterator;

import data.set.OfflineSetIterator;


/**
 * Builds an offlinesetiterator in memory
 * @author guillaumes
 *
 * @param <A> : the type of what is containing in this iterator
 */
public final class OfflineSetIterator_Memory<A> implements OfflineSetIterator<A> {

	protected Iterator<A> objects;
	protected Iterator<Integer> ids;
	protected A current_object;
	protected int current_id;
	
	/**
	 * 
	 * @param objects : the iterator of the objects
	 * @param ids : the iterator of the ids
	 *  
	 */
	public OfflineSetIterator_Memory(Iterator<A> objects,Iterator<Integer> ids)
	{
		this.objects=objects;
		this.ids=ids;
	}
	
	public int getCurrentId() {
		return(current_id);
	}

	public A getCurrentObject() {
		return(current_object);
	}

	public boolean hasNext() {
		return(objects.hasNext());
	}

	public void next() {
		current_object=objects.next();
		current_id=ids.next();
		
	}
}
